This is the core bit that fixes the crash.