Fixed more bugs in model loading