Remove redundant piece of code
Fix swapping induced failure of history_find*