Updated fix to properly account for removing files vs. folders.