Give the arduino a bit more time to power up after reprogramming. Leonardo caused a serial exception.