Fix some compatibility issues with Debian6 and older numpy