Fixed reqrite history bug.