Improve fix for crash on startup.