More use of the try-with-resources.