Added code to free line listing. Also added more code for generating syntax errors.
Fixed an inconsistency with line numbers in listing.