Revert "Clean up store.c store_object_similar() and fix a bug."

This reverts commit fb644d8f002c9c004efcd698024f02eb9c0b0365.