Fixing numpy 1.8.0 compatibility