Removes invalid history