Changed lists to dictionaries in some cases