Fixed #175; Solved some crashes from the firmware uploads

Tested on real hardware for 8 or so uploads. Needs to be monitored.
Merge branch 'bug/175'