fixed bugs preventing compile with Arduino 1.5.7

implemented fixes posted by Liss here:
http://arduiniana.org/libraries/flash/