Index: Singular/ipshell.cc
===================================================================
--- Singular/ipshell.cc	(revision 9b1590d4c8e281abd068646c9d699284f9ea053a)
+++ Singular/ipshell.cc	(revision 3a8a0d9e52567f7dba1baa11b44dab3cad571fe5)
@@ -2278,4 +2278,5 @@
          && ((R->order[jj]== ringorder_a)
             || (R->order[jj]== ringorder_aa)
+            || (R->order[jj]== ringorder_am)
             || (R->order[jj]== ringorder_c)
             || (R->order[jj]== ringorder_C)
Index: libpolys/polys/monomials/p_polys.cc
===================================================================
--- libpolys/polys/monomials/p_polys.cc	(revision 9b1590d4c8e281abd068646c9d699284f9ea053a)
+++ libpolys/polys/monomials/p_polys.cc	(revision 3a8a0d9e52567f7dba1baa11b44dab3cad571fe5)
@@ -122,16 +122,15 @@
         case ro_am:
         {
-          ord=POLY_NEGWEIGHT_OFFSET;
-          int a,e;
-          a=o->data.am.start;
-          e=o->data.am.end;
-          int *w=o->data.am.weights;
+          ord = POLY_NEGWEIGHT_OFFSET;
+          const short a=o->data.am.start;
+          const short e=o->data.am.end;
+          const int * w=o->data.am.weights;
 #if 1
-          for(int i=a;i<=e;i++) ord+=p_GetExp(p,i,r)*w[i-a];
-          int c=p_GetComp(p,r);
+          for(short i=a; i<=e; i++, w++)
+            ord += ((*w) * p_GetExp(p,i,r));
 #else
           long ai;
           int ei,wi;
-          for(int i=a;i<=e;i++)
+          for(short i=a;i<=e;i++)
           {
              ei=p_GetExp(p,i,r);
@@ -139,13 +138,20 @@
              ai=ei*wi;
              if (ai/ei!=wi) pSetm_error=TRUE;
-             ord+=ai;
+             ord += ai;
              if (ord<ai) pSetm_error=TRUE;
           }
 #endif
-          if ((c>0)&&(c<=o->data.am.len_gen))
+          const int c = p_GetComp(p,r);
+
+          const short len_gen= o->data.am.len_gen;
+          
+          if ((c > 0) && (c <= len_gen))
           {
-            ord+=w[c-(e-a)+2];
+            const int * const wm = o->data.am.weights_m;
+            assume( wm[0] == len_gen );
+            ord += wm[c];
           }
-          p->exp[o->data.am.place]=ord;
+          
+          p->exp[o->data.am.place] = ord;
           break;
         }
Index: libpolys/polys/monomials/ring.cc
===================================================================
--- libpolys/polys/monomials/ring.cc	(revision 9b1590d4c8e281abd068646c9d699284f9ea053a)
+++ libpolys/polys/monomials/ring.cc	(revision 3a8a0d9e52567f7dba1baa11b44dab3cad571fe5)
@@ -357,5 +357,5 @@
         if (r->order[l]!=ringorder_M) break;
       }
-      if (r->order[l]==ringorder_am) /*j==0*/
+      if (r->order[l]==ringorder_am)
       {
         int m=r->wvhdl[l][i];
@@ -2207,7 +2207,9 @@
     long *o, sro_ord &ord_struct, int *weights)
 {
+  assume(weights != NULL);
+  
   // weighted degree (aligned) of variables v_start..v_end, ordsgn 1
-  while((start<end) && (weights[0]==0)) { start++; weights++; }
-  while((start<end) && (weights[end-start]==0)) { end--; }
+//  while((start<end) && (weights[0]==0)) { start++; weights++; }
+//  while((start<end) && (weights[end-start]==0)) { end--; }
   rO_Align(place,bitplace);
   ord_struct.ord_typ=ro_am;
@@ -2215,6 +2217,8 @@
   ord_struct.data.am.end=end;
   ord_struct.data.am.place=place;
+  ord_struct.data.am.weights=weights;
+  ord_struct.data.am.weights_m = weights + (end-start+1);
   ord_struct.data.am.len_gen=weights[end-start+1];
-  ord_struct.data.am.weights=weights;
+  assume( ord_struct.data.am.weights_m[0] == ord_struct.data.am.len_gen );
   o[place]=1;
   place++;
Index: libpolys/polys/monomials/ring.h
===================================================================
--- libpolys/polys/monomials/ring.h	(revision 9b1590d4c8e281abd068646c9d699284f9ea053a)
+++ libpolys/polys/monomials/ring.h	(revision 3a8a0d9e52567f7dba1baa11b44dab3cad571fe5)
@@ -93,6 +93,9 @@
   short end;
   short len_gen; // i>len_gen: weight(gen(i)):=0
-  int *weights; // pointers into wvhdl field of length (end-start+1) + len_gen
-                // contents w_1,... w_n, len, mod_w_1, .. mod_w_len, 0
+  int *weights; // pointers into wvhdl field of length (end-start+1) + len_gen + 1
+                // contents w_{start},... w_{end}, len, mod_w_1, .. mod_w_len, 0
+  int *weights_m; // pointers into wvhdl field of length len_gen + 1
+                // len_gen, mod_w_1, .. mod_w_len, 0
+  
 };
 typedef struct sro_am sro_am;
