Fixed crashes when switching fragments #24