Fix issue #47 - LOC record parsing

See unit test added by first commit. Tests #1, #2 and #4 are failing with current master branch.