diff --git a/boxmox/data.py b/boxmox/data.py
index 0c90e795fd1363221f3317a4ae9e564659033e4d..8327b1307a0f75e08cadfbf9928da43df642afd3 100644
--- a/boxmox/data.py
+++ b/boxmox/data.py
@@ -108,7 +108,7 @@ class InputFile17:
             self.timeVar  = hdr[0]
             self.time     = [ x[0] for x in dmp ]
             ntime = 1
-        self.anc        = { hdr[i]: [ x[i] for x in dmp ] for i in range(ntime, ntime+nanc) }
+        self.anc       = { hdr[i]: [ x[i] for x in dmp ] for i in range(ntime, ntime+nanc) }
         self._data     = { hdr[i]: [ x[i] for x in dmp ] for i in range(ntime+nanc, len(dmp[0])) }
 
     def __str__(self):
@@ -140,7 +140,12 @@ class InputFile17:
                 line = [ xtime ] + [ self.anc[key][itime] for key in anc_names ] + [ self._data[key][itime] for key in data_names ]
                 f.write(' '.join('{0:e}'.format(x) for x in line) + '\n')
         else:
-            data_line = ' '.join( '{0:e}'.format(float(self.anc[x])) for x in self.anc.keys() ) + ' ' + ' '.join( '{0:e}'.format(float(self._data[x])) for x in self.keys() ) + '\n'
+            def _data_fix(key):
+                if isinstance(self._data[x], list):
+                    return self._data[x][0]
+                else:
+                    return self._data[x]
+            data_line = ' '.join( '{0:e}'.format( float(self.anc[x])) for x in self.anc.keys() ) + ' ' + ' '.join( '{0:e}'.format( float(_data_fix(x))) for x in self.keys() ) + '\n'
             if not self.time is None:
                 data_line = '{0:e}'.format(float(self.time)) + ' ' + data_line
             f.write(data_line)
@@ -227,7 +232,12 @@ class InputFileOrig:
                 f.write(' '.join('{0:e}'.format(x) for x in line) + '\n')
         else:
             f.write('{0:s}' .format(' '.join( column_names)) +'\n')
-            f.write(' '.join( '{0:e}'.format(float(self._data[x])) for x in self.keys() ) + '\n')
+            def _data_fix(key):
+                if isinstance(self._data[x], list):
+                    return self._data[x][0]
+                else:
+                    return self._data[x]
+            f.write(' '.join( '{0:e}'.format(float(_data_fix(x))) for x in self.keys() ) + '\n')
 
     def __init__(self, fpath=None):
         #: Time format (0: constant, 1: seconds since start, 2: hour of diurnal cycle)