Bugfix: offsets were being computed incorrectly

Forgot to index by element size; D'oh.