uninitialised variable, check if xml node has childnodes

minor fixes