Fixed groups not being inserted into the database