Added some unit tests around bad/duplicate keys.