Fix invalid line detection

Oops