Line tracer invalid chunk fix

* Fixes #1230
* Additionally improved speed in some scenarios