gray-inferencer: fixing bad behavior on mangling end position of writes

+ odd things like end before start occurred this way
+ thanks @hsj0660 for helping to find this