Enable try-with-resource (#635)