Better building of the new process environment.

Changes as per code review.