some python3 compat fixes