Added a check to make sure a parent node exists in call remove() to avoid errors...