Fix overflow in NumPy 1.7 as suggested by Julian Taylor.