Fixes NPE exception that can prevent removing group.