Should probably constrain the types of the children. (Assert that $pid is an issue)