More fixes on primary category resolving