Fix removal of tmp file