Changed the test if a $node variable is set.