Better error handling

Terminate immediately when --lines matches are found.