Modify tabRemoval function to only run on files when necessary. Catch errors
Merge branch 'tab_removal'