Figured it out.

The problem was "define ADC_BITS 8". Not sure why I did that. Changed it to 10 and it works fine now.