Changes to support Python3