Merge "Fixed bug on pending environment use of termination condition. With regression test."