RuleContext cleanup.

A few fixes here and there.