Commit some changes applied in old 'qemu' branch.

These last-minute changes seem to restore the ability to enter and
exit simulation without issue and were applied or based on the prior
'qemu' (1.2) branch.