Added more test cases and fix old rules.