Tweaked the history lookup.