Corrected several errors in deploy script