Various fixes to deploy script.