Fixed removal of temporary file