Finally, a version that passes the tests (?!).
Rule cleanup.