Hello Damian,
I reported a bug report here: https://trac.torproject.org/projects/tor/ticket/31823#comment:19
I just reopened the old trac ticket but I think this is suboptimal.
Would you prefer me to open new tickets in the future, or maybe open an issue on Github? I can do whatever is convenient for you!
Thanks for all the code! So far it works great!