Removed invalid variables before saving and deploy/reconfigure, improved waitForCompletion()