more python3 compatibility edits