Overflow bug fixed in cleanDictionary