Fixes hang if closing unopened file