Updated to clean-up handles if unable to load (rare memory leak)