Improve handling of loading failures to fail with a message instead of crashing