Fix bugs when displaying groups