Fix 1-off bug and respective tests.

As an interface, optMage expects positions to be 1-indexed. Internally
it uses pythonic coordinates.