fixes for numpy 1.9.1 #342

Fixed indexing errors related to the new NumPy version. Floating point errors are occurring, but 1.8.2 is still the default NumPy version.