Fixed error when there is only one rule - it is a type error. We should consider using classes rather than dictionaries for rules to mediate this.