Fix a bug that causes a segmentation fault.
Fix a bug that insert() overwrites an existing key.