diff --git a/fsl/data/image.py b/fsl/data/image.py
index 415018c2a92bafc8a0589194603af0608cc17dd8..e6b15709153a8e3ea56d078810ebc7c4eb5e68be 100644
--- a/fsl/data/image.py
+++ b/fsl/data/image.py
@@ -337,9 +337,9 @@ class Nifti(notifier.Notifier, meta.Meta):
             # get the shape/size of the coefficient
             # field about right
             knotpix       =  header.get_zooms()[:3]
-            refpix        = (header.get('intent_p1', 1),
-                             header.get('intent_p2', 1),
-                             header.get('intent_p3', 1))
+            refpix        = (header.get('intent_p1', 1) or 1,
+                             header.get('intent_p2', 1) or 1,
+                             header.get('intent_p3', 1) or 1)
             voxToWorldMat = affine.concat(
                 affine.scaleOffsetXform(refpix,  0),
                 affine.scaleOffsetXform(knotpix, 0))
diff --git a/fsl/data/mghimage.py b/fsl/data/mghimage.py
index fea4c9970ecae56ec84f2274f656f11e3e6df2e8..a143e06ce1e3ce9a2367444c7e67408459e3cd36 100644
--- a/fsl/data/mghimage.py
+++ b/fsl/data/mghimage.py
@@ -69,7 +69,7 @@ class MGHImage(fslimage.Image):
 
         self.__voxToSurfMat   = vox2surf
         self.__surfToVoxMat   = affine.invert(vox2surf)
-        self.__surfToWorldMat = affine.concat(affine, self.__surfToVoxMat)
+        self.__surfToWorldMat = affine.concat(xform, self.__surfToVoxMat)
         self.__worldToSurfMat = affine.invert(self.__surfToWorldMat)