Made copy-hash-table more general