semantic: improve error report, fix source lines