XD-677 Fixed deployer bug and associated deployAndUndeploy tests