Some fixes and improvements in model loading processes