Fixes so the firmware now builds. Not tested on hardware as yet.