Fix type checking when using the new version of Twisted.