Update for group membership handling for departments. Needs more testing. #165