Replaced all 'dict.has_key(item)' with 'item in dict' expressions.