fix bug in last commit where getchildindex got totally broken