This could be a solution for you.
Code:
checkbox.setRawValue(true);
checkbox.lastValue = true;
and
Code:
checkbox.setRawValue(false);
checkbox.lastValue = false;
The idea is to set a checkbox's lastValue to the same value which you pass to a setRawValue call.