Compatibility for NumPy < 1.7
Changes for Linux compilation