Fixed infinte loop on group add, minor updates

Database is created if it does not already exist