Add a test for adding multiple objects to the hash table.

Also fix a memory leak.