WIP fix py2.7 incompatibilities.