Miscellaneous fixes ISSUE=5461
Miscellaneous fixes ISSUE=5461

Because I'm sure there's someone somewhere who writes large amounts of code
perfectly the first time, but it sure isn't me.

GlobalNOC/simp,GlobalNOC/simp,GlobalNOC/simp,GlobalNOC/simp,GlobalNOC/simp