Merge QA-driven fixes into master

This should have been done a few days ago. Not sure how it was missed.