Fixes problem with empty nodes