Fix the tree not refreshing when deleting a resource (fix #335).