Fix ns tests and micro optimize ht.c when its empty