Fix a bug in custom rule condition (credit WS)