Fix bug where delete_tree only deletes first-level children

Signed-off-by: Philipp Tempel <phtempel@gmail.com>