Fixed TreeSet contains issues