Index: Singular/iparith.cc
===================================================================
--- Singular/iparith.cc	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ Singular/iparith.cc	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -7696,4 +7696,5 @@
     GbVariant alg=syGetAlgorithm((char*)u4->Data(),currRing,I);
     // CopyD for IDEAL_CMD and MODUL_CMD are identical:
+    res->rtyp = u->Typ();
     res->data = (char *)idLiftStd((ideal)u->Data(),
                                 &(hv->data.umatrix),testHomog,
Index: Tst/Old/liftstan.res.gz.uu
===================================================================
--- Tst/Old/liftstan.res.gz.uu	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ Tst/Old/liftstan.res.gz.uu	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -1,4 +1,4 @@
 begin 644 liftstan.res.gz
-M'XL("!B''6`"`VQI9G1S=&%N+G)E<P"55<%NVS`,O?LKB&`'9U!32W:RMH%]
+M'XL("`BH'6`"`VQI9G1S=&%N+G)E<P"55<%NVS`,O?LKB&`'9U!32W:RMH%]
 M*'8I,.S2G1H$@>LXA5#++BPWD_3UHY145K>BR80$H:GW*#Z19NY_?;_["0"T
 M@,O+Z/[XQ&;X!$,M!Y!5SU\&V'4]-'PWR&$+52=$V6X].IV%W&P&/6^?H*>0
Index: Tst/Old/liftstan.stat
===================================================================
--- Tst/Old/liftstan.stat	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ Tst/Old/liftstan.stat	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -1,4 +1,4 @@
-1 >> tst_memory_0 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:87656
-1 >> tst_memory_1 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:2277376
-1 >> tst_memory_2 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:2308048
-1 >> tst_timer_1 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:3
+1 >> tst_memory_0 :: 1612556296:4201, 64 bit:4.2.0:x86_64-Linux:terra:87656
+1 >> tst_memory_1 :: 1612556296:4201, 64 bit:4.2.0:x86_64-Linux:terra:2277376
+1 >> tst_memory_2 :: 1612556296:4201, 64 bit:4.2.0:x86_64-Linux:terra:2308048
+1 >> tst_timer_1 :: 1612556296:4201, 64 bit:4.2.0:x86_64-Linux:terra:2
Index: Tst/Short/bug_liftstd4.res.gz.uu
===================================================================
--- Tst/Short/bug_liftstd4.res.gz.uu	(revision ff4cbacc83944accd7caea5f872dc17187736644)
+++ Tst/Short/bug_liftstd4.res.gz.uu	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -0,0 +1,10 @@
+begin 644 bug_liftstd4.res.gz
+M'XL("&^P'6`"`V)U9U]L:69T<W1D-"YR97,`A9%+:X0P%(7W_HJ#=!$A9-3:
+M%]+`E&X&2A?572F#@X\&K$J,C/[[7G6(+5V4!!+./1^Y]R1)GP^O``*)E\,3
+M7-,;4:N3&SO)I1)*D'A4C3+,BYWYA)0X#=6Q5B65\D@TQ5GT)C,6NI:P]TA@
+MMX,NS*`;F*DKT)98T!QG93X1(=-5;_TW8F-O!;1J*KSA$3YG(Y\\7G=;<W<2
+M7YG1:L3^/?R@3;Z1^[2FS71O3>DF/I#8YD-=(+%BX,NEP;9DE]'8ZF%[CZ<\
+MX2Y)KD<IK++E*+V.^C3_83X?N3-QWPX8A']>5'F1U>NDO]A%M]R/@`,*>/ZA
+2^0.&G@5>?.5\`S3!>)37`0``
+`
+end
Index: Tst/Short/bug_liftstd4.stat
===================================================================
--- Tst/Short/bug_liftstd4.stat	(revision ff4cbacc83944accd7caea5f872dc17187736644)
+++ Tst/Short/bug_liftstd4.stat	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -0,0 +1,4 @@
+1 >> tst_memory_0 :: 1612558447:4201, 64 bit:4.2.0:x86_64-Linux:terra:84776
+1 >> tst_memory_1 :: 1612558447:4201, 64 bit:4.2.0:x86_64-Linux:terra:2150192
+1 >> tst_memory_2 :: 1612558447:4201, 64 bit:4.2.0:x86_64-Linux:terra:2191296
+1 >> tst_timer_1 :: 1612558447:4201, 64 bit:4.2.0:x86_64-Linux:terra:3
Index: Tst/Short/bug_liftstd4.tst
===================================================================
--- Tst/Short/bug_liftstd4.tst	(revision ff4cbacc83944accd7caea5f872dc17187736644)
+++ Tst/Short/bug_liftstd4.tst	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -0,0 +1,14 @@
+LIB "tst.lib";
+tst_init();
+
+// return type of liftsd with 4 args
+
+ring R = 0,(x,y),lp;
+matrix A[2][2] = x,0,0,y;
+matrix T;
+module S;
+typeof(liftstd(module(A),T,S,"std"));
+print(liftstd(module(A),T,S,"std"));
+typeof(liftstd(ideal(x,y),T,S,"std"));
+
+tst_status(1);$
Index: Tst/Short/liftstd_s.res.gz.uu
===================================================================
--- Tst/Short/liftstd_s.res.gz.uu	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ Tst/Short/liftstd_s.res.gz.uu	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -1,4 +1,4 @@
 begin 644 liftstd_s.res.gz
-M'XL("!B''6`"`VQI9G1S=&1?<RYR97,`G1A=;YM(\-V_8I3>`Z[7E`4#=G)8
+M'XL("#*H'6`"`VQI9G1S=&1?<RYR97,`G1A=;YM(\-V_8I3>`Z[7E`4#=G)8
 M5G4OE:I[N.:IEA41@E.N@"W`*5#=?[_9-<PNMM/X#B5FV/G8^1Z6+_=_?/H3
 M`/@2/G_Z"#=569EI\GAS-_K28>PEX.)#DB>5,;X;B3LLEY`F6UQ^>BC-//YA
Index: Tst/Short/liftstd_s.stat
===================================================================
--- Tst/Short/liftstd_s.stat	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ Tst/Short/liftstd_s.stat	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -1,4 +1,4 @@
-1 >> tst_memory_0 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:85960
-1 >> tst_memory_1 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:2183168
-1 >> tst_memory_2 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:2308016
-1 >> tst_timer_1 :: 1612547864:4201, 64 bit:4.2.0:x86_64-Linux:terra:3
+1 >> tst_memory_0 :: 1612556338:4201, 64 bit:4.2.0:x86_64-Linux:terra:85960
+1 >> tst_memory_1 :: 1612556338:4201, 64 bit:4.2.0:x86_64-Linux:terra:2183168
+1 >> tst_memory_2 :: 1612556338:4201, 64 bit:4.2.0:x86_64-Linux:terra:2308016
+1 >> tst_timer_1 :: 1612556338:4201, 64 bit:4.2.0:x86_64-Linux:terra:4
Index: Tst/Short/ok_s.lst
===================================================================
--- Tst/Short/ok_s.lst	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ Tst/Short/ok_s.lst	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -8,4 +8,5 @@
 bug_ecart
 bug_heuristic
+bug_liftstd4
 bug_mem_Z
 bug_misc
Index: kernel/ideals.cc
===================================================================
--- kernel/ideals.cc	(revision 17bc740f922270721b5e3d90af6f93dfd834b750)
+++ kernel/ideals.cc	(revision ff4cbacc83944accd7caea5f872dc17187736644)
@@ -938,5 +938,5 @@
   SI_SAVE_OPT2(save2);
 
-  k=si_max(1L,id_RankFreeModule(h1,currRing));
+  k=si_max(1,inputIsIdeal);
 
   if ((!lift3)&&(!TEST_OPT_RETURN_SB)) si_opt_2 |=Sy_bit(V_IDLIFT);
