Correctly count lines