Improved storing of rules.