Changed the model loading code.