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

Closes PR13544.