NPE fixed when undeployAll is called

Signed-off-by: Julien <jlehuraux@chyro.fr>
undeployAll not async and unnecessary undeployments fixed

Signed-off-by: Julien <jlehuraux@chyro.fr>
Merge upstream/master

Signed-off-by: Julien <jlehuraux@chyro.fr>
Merge pull request #575 from julien3/master

NPE thrown when undeployAll is called