Fix python3 incompabilities