Tweaked model loading related code.