Clean up use of temp files; fix clipboard issue.