Issues 4986

Working on merging in GH-4986. I added some new integration tests to verify that this will test clean. Also I cleaned up some formatting issues while I was doing commits anyways.