Fixing bug in model loading