Fixed bugs in rules and cubes