Added proper exceptions for model loading.