python3 partial fixes / code cleanup