Fixed getChild to work with fields Ids

The type of this.children[i] returns object.
The if statement is never true because of this and enum children cannot be accessed by their id.