Fix flashing of arduino on firmware version mismatch
Cleaning code