Fix compile errors for avr