(Painful) python 3 support.