Backport build fix from trunk
Backport update and fix from trunk.
Update joyent and wip