Added better error handling. in version 6.5 Messages should indicate the error line where it occurred. In case of a problem, please provide the line number