Deduplicating history (fix for @egamble)