Improve resolution logic for dynamic sets
Fix `count` state for read only relation sets