diff --git a/fsl/data/constants.py b/fsl/data/constants.py
index d257945ec6c53afe6c4a2489cef2d94cba06d4e9..5a870ccf03f5dd457fd39bd70137b9448891282f 100644
--- a/fsl/data/constants.py
+++ b/fsl/data/constants.py
@@ -85,6 +85,19 @@ NIFTI_XFORM_ANALYZE      = 5
 """Code which indicates that this is an ANALYZE image, not a NIFTI image. """
 
 
+# NIFTI unit codes
+NIFTI_UNITS_UNKNOWN = 0
+NIFTI_UNITS_METER   = 1
+NIFTI_UNITS_MM      = 2
+NIFTI_UNITS_MICRON  = 3
+NIFTI_UNITS_SEC     = 8
+NIFTI_UNITS_MSEC    = 16
+NIFTI_UNITS_USEC    = 24
+NIFTI_UNITS_HZ      = 32
+NIFTI_UNITS_PPM     = 40
+NIFTI_UNITS_RADS    = 48
+
+
 # NIFTI file intent codes
 NIFTI_INTENT_NONE          = 0
 NIFTI_INTENT_CORREL        = 2
diff --git a/fsl/data/image.py b/fsl/data/image.py
index 4efea8e021c03973760c295df3b4c59d4e4df7b8..0952f585518a5af874dfab62d549b72f590364ff 100644
--- a/fsl/data/image.py
+++ b/fsl/data/image.py
@@ -332,6 +332,10 @@ class Nifti(notifier.Notifier):
     def xyzUnits(self):
         """Returns the NIFTI XYZ dimension unit code. """
 
+        # analyze images have no unit field
+        if self.niftiVersion == 0:
+            return constants.NIFTI_UNITS_MM
+
         # The nibabel get_xyzt_units returns labels,
         # but we want the NIFTI codes. So we use
         # the (undocumented) nifti1.unit_codes field
@@ -345,6 +349,10 @@ class Nifti(notifier.Notifier):
     def timeUnits(self):
         """Returns the NIFTI time dimension unit code. """
 
+        # analyze images have no unit field
+        if self.niftiVersion == 0:
+            return constants.NIFTI_UNITS_SEC
+
         # See xyzUnits
         units = self.header.get_xyzt_units()[1]
         units = nib.nifti1.unit_codes[units]
@@ -742,10 +750,20 @@ class Image(Nifti):
 
             # We default to NIFTI1 and not
             # NIFTI2, because the rest of
-            # FSL is not yet NIFTI2 compatible.
-            nibImage = nib.nifti1.Nifti1Image(image,
-                                              xform,
-                                              header=header)
+            # FSL is not yet NIFTI2 compatible. 
+            if header is None:
+                ctr = nib.nifti1.Nifti1Image
+
+            # But if a nibabel header has been provided,
+            # we use the corresponding image type
+            if isinstance(header, nib.nifti2.Nifti2Header):
+                ctr = nib.nifti2.Nifti2Image
+            elif isinstance(header, nib.nifti1.Nifti1Header):
+                ctr = nib.nifti1.Nifti1Image 
+            elif isinstance(header, nib.analyze.AnalyzeHeader):
+                ctr = nib.analyze.AnalyzeImage
+
+            nibImage = ctr(image, xform, header=header)
             
         # otherwise, we assume that it is a nibabel image
         else:
@@ -1026,6 +1044,7 @@ class Image(Nifti):
         .. note:: Modifying image data will force the entire image to be 
                   loaded into memory if it has not already been loaded.
         """
+        values = np.array(values)
 
         log.debug('{}: __setitem__ [{} = {}]'.format(self.name,
                                                      sliceobj,