Python3 syntax fixes and remove some debug strings