Lots and lots of bugfixes to make things work for musashi.