1) fixed unit tests 2) fixed a bunch of leaks having to do with using enumerators. Thanks for noticing these, Simon. 3) fixed a tiny problem in nsTextEditRules::WillDoAction(). This method was overly aggressive in checking input args, sel can be null for some operations.