Fix bug in which a line count without empty lines was incorrectly used