Corrected line number counting (starts from zero)