Can't script filling a transparent layer mask with full black
I'm working on a script that is supposed to clear a background. Due to some initial preprocessing some semi-transparent pixels are present in the layer that I would like to remove. See the inverse selection here:

If attempt to use selection.clear() with the activeLayer selected, I'm still left with artifacts, and it also deletes up into the white part of the selection. I get the same effect using Delete manually. Here's after one delete.

I've also tried using selection.fill(solid black) to no avail; it still only partially fills. Same effect if I try to fill using Edit >> Fill.
What am I missing? Thanks in advance.
