[code review] fixes

* Fixed allocation memory.
* Fixed counters.
* Rename function from macros CLEAN_struct() to FREE_struct().