Put in temp file deleting code for #88 and fixed some bugs