Fix for clearing empty nodes.