Crash fix for loading

Resolves #624