Fix a typo in ReadPos counter that likely yielded incorrect values and
improve error handling in that counter