Validate rules, instead of doing it by key. Closes #3792.