Clean up offset handling.
Merge branch 'master' into gh-pages