small py3 fixes

@y-p correcting those small fixes I mentioned in the comments of your commit.