Cleaned up and added line number to error messages