Fix #159

Being optimistic and hoping that my minimal understanding of the codebase is enough to inform this fix, and that it actually works. Fingers crossed…