Stop the node of crashing

Signed-off-by: Delian Delchev <delian.delchev@gmail.com>
Few small fixes

Signed-off-by: Delian Delchev <delian.delchev@gmail.com>