Switched to new try-with-resources.