Rollback 7d5790225bec

Because of course this doesn't work in remote mode.
Also make temp-dir optional