Fix: timeout undefined (branched)

Branched it off but it has the merges from my last PR too, though it shouldn't make a difference as you already have those.

Fixes the timeout having undefined `this`.