Fixed possible crash on startup