Rewritten line detection, fixing #1