Fixed remove_tree case ordering (check for directory first)