Clean up deploy script
Fix minor bugs
Minor fixes