Android: Fixing bugs with preferences.