Fixed bug related to primary group deletion