Change handling of end-of-definition / end-of-transmission

Caused wrong handling of positions