Fixed error in the unsafe add child function.