Fix homeworks creation when more than one group exists