Fix rules creation