[nodes handling] - Fixed code according to comments from @jglick

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>