Fixed initialization flags and reading the ADC