Fix Twisted and Python 3 breakage.