Fixes #373
Merge pull request #374 from ben-ng/async-init-fix

Fix async init scripts being run in the wrong context