more py3-related fixes