A simple groups variable wasn't properly defined. Fixed.