py3-related fixes