add tests for CBAR_THRESHOLD
fix gt/ge discrepancy that could lead to FLAPPING.