Fixed possible crash.