Fix for numpy<1.8