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

Change-Id: I7d57341d2146934de62aeb600c9aff13c75aebbe