Merge QA-driven fixes into master

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