Fixes async behaviour with the CLI; shellcraft was ending too quickly because the last callback was called immediatly.