fixed unit test error on some boundary condition.