I think we also need to verify that ``$root`` is not false, no?