some python3 syntax compatibility changes