Patches for choose state level when expected value not received [sf#1082275] [#347]