Fix for https://trac.torproject.org/projects/tor/ticket/13187#comment:10