Fix #111
Need to modify BOM test a bit: not sure if this is the right thing, but keeping track of real input offsets seems more important