Fix a myriad of small issues

None of these added up to a PR on their own, but together they fix about 10ish open issues