Optimizations

Some minor and easy stuff. Please, take a look where I've commented "caution": in most of C implementations and libraries, NULL is defined to be 0 but as I don't know avr that well and I've not the hardware to test it right now neither, take it with a grain of salt and accept it only it works for you.