Fixed a memory leak caused by not deleting child nodes