Fix null deref in ht.c