Fixed bugs in compare-to-one functions