Created a new HashSet instead of clearing it

I don't think that it will make a difference, but it's worth
a try. For issue #19.