fix and cleanup line numbers