Do not overflow line number on excessively large files.
Less branches.
Actually ignore lines with invalid flags.

While at it, don't ignore all following lines.