Fix security group handling