Add security group tests, fix some bugs

Signed-off-by: Shea Levy <shea@shealevy.com>