Properly build output hash table