MB-146 #Fixed logic for deleting users and groups, and updated tests