Proposed fix for issue #57

The problem turned out to be how the division operator ("/") is handled now in Python 3. "/" returns float while "//" returns an integer. The problem was that some operations were dividing and then using the float result to index arrays.