Merge branch 'master' into astropy

Merges up through r2072 from PyFITS

Fixes issues #256, #309 in Astropy, and several issues from PyFITS' bugtracker.