Fixed minor bugs, added rules.