fix bug in rehashing typeToTypeId table. ref #5688