fix minor bugs in revert