Moved return of  outside for loop
Merge pull request #15 from tanepiper/master

Moved return $node outside loop