Fixed more bugs with deploy script