compile_avr bug fix and checking for main function