Fixed crashes on changing activity.