UpdateDeploymentScript

Fixes in deployment script to avoid type case exceptions
Merge pull request #1003 from bhuvak/bug-821

UpdateDeploymentScript