Final changes to get clean compile on MacOSX

Also fixes issue with File dialog not allowing selection of .nii.gz files.