Fixed things so the app doesn't crash.