BS-10042
Fix validation algorithm