more Python3 stuff
This patch fixes a few small issues with syntax changes for dict objects as well as how a few errors were raised. I found these in "non-standard" workflows, which would explain why they might have slipped through until now.
I did not test any of the code after making these changes, but they're (hopefully) trivial enough that we don't have to run full batch/streaming pipelines to check them. Let me know if you'd like to see any particular testing, though, and I'll make it happen.