JC-1508 Fixed UniqueValidator. Added tests.