Fix for astropy API change