Clean up tmp files
Fixed history reply