Make kw/opt lambda special checks work with other expected values.

Closes PR13544.