If: Increase test coverage and refactor condition evaluation
Merge topic 'if-sanity' into next

3d63361c If: Increase test coverage and refactor condition evaluation