Deploy script improvements by @thenbrent.