misc fixes

also supports most of the firmware building