Fixed writer's memory leaks by deleting temporary dictionaries. Fixed regression of writing inflated contents