Removing overzealous closing of resources