Fixed errors in ADC code