UpdateDeploymentScript

Fixes in deployment script to avoid type case exceptions