Fix typo
Add scope(exit) statements to remove temporary files