Fix the reporting of the line numbers

Not yet completely correct, need to be fixed.