fixing some bugs in hdr2nii.py