Fix global-to-local indexing (see gh-issue #154).

Closes issue #154.