Changed all dictionary lookups from [key] to .get(key)