Added automated freeing to htable implementation.