Proper hashtable cleanup