Backport fixes from trunk.
Merge branch 'joyent/feature/multiarch/2013Q2' into joyent/release/2013Q2_multiarch