diff --git a/TimeSeries/s2theia.py b/TimeSeries/s2theia.py
index 3a6d15e7c9b054f398e49618bb3668d711065a73..c218936fefd93871bd39d6acd3f88dc990bcf82e 100644
--- a/TimeSeries/s2theia.py
+++ b/TimeSeries/s2theia.py
@@ -599,7 +599,7 @@ class S2TheiaTilePipeline:
         if not os.path.exists(self.temp_fld):
             os.makedirs(self.temp_fld)
 
-        with open(os.path.join(self.temp_fld, self.tile_id + '_indates.txt'), 'w') as df:
+        with open(os.path.join(self.folder, self.tile_id + '_indates.txt'), 'w') as df:
             [df.write(x + '\n') for x in self.input_dates]
 
         if output_dates is not None:
@@ -816,7 +816,7 @@ class S2TheiaPipeline:
                         t.rigid_align(match_band=align_using_band-1)
                 t.reproject(self.output_epsg)
                 if warp_to is not None:
-                    t.coregister(warp_to, warp_to_band, warp_using_and, t.temp_fld)
+                    t.coregister(warp_to, warp_to_band, warp_using_band, t.temp_fld)
                 t.gapfill(self.output_dates, store_gapfill)
                 stack_name = t.generate_feature_stack(feat_list)
                 out.append(t.write_outputs(out_fld))