Added in the good parts of the revert and fixed some configuration problems for deployment