add forgotten files from the last commit

woe is me, when shall i ever learn?
fix some bugs in the firmware i missed before the merge