Factor out setTimeout, fix type error
Merge pull request #1 from paf31/master

Factor out setTimeout, fix type error