Improve closing of files in error situations.