Minor: improved JSON manipulation
Fixed issue on cleaning record tracking after delete