See #51, resolve dependencies before calling initialize

Needed to put this into a separate branch and PR otherwise it screws up git history.