minor tidy-ups, remove duplicate keys