Added ability to handle nodes with multiple labels.