Fixes #43, should work on NumPy 1.6+.