Improved group-access, also more sql related stuff