Changes to make build independent of version of astropy