Fix some broken clamping in rate control.