Some improvements to the error reporter
Cross version compatibility stuff for error reporting.