Fix quantize bug