Fix calculation of line number

Do not print error message for positive line numbers.