Fix resolving over lines without proper termination

Closes #199.