How do masks work?

Lets say I have a simple terrain, then i have Select slope device and Erosion device. I thought that if i connect both, Slope selector and Errosion to output of my terrain and than connect Slope selector to mask slot of Errosion device, Errosion should happen only on the part of the terrain that is selected by Slope selector. No matter what I try, Errosion is still happening on the whole terrain, like if there would be no mask at all.
Are the masks supposed to work somehow differently? Or is this a bug? If it’s bug, are there any workarounds?

Thanks

Are you sure the Erosion is happening on the whole terrain?
(I don’t have v2.1, I can’t test).

If I’m not wrong, the mask input works that way: the filter is applied on the whole terrain, then the output is mixed with the input depending on the mask.
Another way to do this is to use a Chooser:

Now this is weird and i guess some kind of bug it is. When I opened my project, and selected errosion (which had slope selector in mask slot) i actually saw that errosion working only on part of the terrain. I went back to slope selector and inverted it, but this time when i selected errosion, again it worked on the whole terrain and from that time on, no matter what i did with slope selector, errosion worked on the whole terrain.

But your example with chooser works just great. Thanks.