Setting mgh affines

Changes to leave the header information alone if the affine information has not changed.  With tests.