Fixed bug with cleaning nodes.

Signed-off-by: feafarot <sly.feafarot@gmail.com>