Fixed bug in model loading and error reporting.