Fix #21 - Preferences crash the emulator