Fix bug on group empty checking.