Switching Environments Loses Custom HttpStack

This pull request fixes this.