Added code to ensure that hop criteria are cleaned up when restoring history.