Removed the own implementation for creating a temporary file, in case deletion of temp file fails, added it as candidate for deletion on exit.