fix rules and tests