Merge "Fixed bug on pending environment use of termination condition. With regression test." am: 27fb1dc467
am: b0d6493751

Change-Id: Iba9b5b929145e5675520ab551eaee283f48ac6a6