Issue #51 again: positioning errors in large files.

Also fixed a couple of typos in the sensor code.