Catch CTRL-W for some windows stopped working

I used the following to close windows with CTRL-W except when the window is Firefox, then I want to pass the key through so that Firefox closes the tab instead of the window:

Key W A C Close
Key (*Firefox) W A C –

However, after I updated from Ubuntu 16.04 to 18.04 this doesn’t work anymore. Pressing CTRL-W closes Firefox along with all open tabs. The issue doesn’t seem to be specific to Firefox, though. I also have similar rules for some other applications and those stopped working as well. Any advice on how to fix this is highly appreciated.

Thank you.

Titus