Remove querystring and add rmdir dependancy
Fix temp directory cleanup