fix >, >=, < and <= comparisons (the logic was reversed)