Modified to work with astropy v0.2.4