Fixing some bugs concerning the rules.
Some minor bugfixing.