Fix wrong variable order in some rules