Fix critical bug in recursive_ls