Fix expected condition bug

Closes-bug: #1313965
Closes-bug: #1296689

Change-Id: I6921d0c75d956a3aaef0af9d78d42bb643103a1d
Merge "Fix expected condition bug"