Fix issues with rule assignment