Fixes some startup crashes.