Corrected opamp gain and vref