Changed the parser and converted it to its original form. There has been a problem in the previous version. The problem was that even the key existed, it could not been found in the hash table. So even though the ht_insert_pair was returning < 0 which meant that the key already exists, the ht_get could not find the pair. So there was this inconsistency.