Buggy code for reverting.