Tweak code to run against python3 on linux