Added a deployment script and squashed a few bugs