Fix asm/avr license and some coverity issues