Fix Exceptions in SecurityGroup removal
Reformat code