Fix chroot assignment and temp dir selection