Cleanup of all the craziness caused by reverts