Fixed crashes when adding new category