Added groups_controller tests and fixed associated bugs