Tidy up lastLineNumber handling