Bug fixes with new deploy modes. Finished development for #24 and #23