Fix incorrect action mask generation in case of overlapping direct+group rules