Keep temporaries for reuse, cleanup before pull (fixes #849, fixes #841)

Seems I haven't finished the job properly.