Correctly return an empty array when no groups found.