Changed getchildren, to accommodate typechecking