[MODULES-168] Fix comparison logic