Fix the handling of maps with invalid rules.  Fixes #6787.
Merge pull request #6788 from pchote/fix-rule-validation

Fix the handling of maps with invalid rules.