GH-5 Fixing shouldPush always true bug and added

a guard children.length === 0 in visitAllChildren to invoke callback