added code for detecting redundant rules.
fix for when the level has value ""