CFY-1215: Address Ran Ziv comments

Fix the code.
Update unit tests.