Fixed security-related bug in NodeFactory.