FW 8.1.1 cherry-picks

Cherry-pick some patches to the branch that will be used by FW 8.1.1. Included some work by regnrand so mccarthyrb's commit would compile.