Fixed compatibility with latest Astropy