Dictionary.ContainsKey before is Dictionary.Remove is redundant

fixes #1628