workaround for bug introduced in numpy 1.7.1 and change to make compatible with current astropy dev version