Move exit conditions to NS environ. as well.

(#1569)