BUG: fix some python3-related issues.