Refactored clean. Fixed memory leak that was caused by change in node id storage.
Another node id fix.