Fix up the temp file renaming
Added a clear() method to clear the current reference