Make filters on mutated/undefined vars an error.

Closes PR 14422.
Closes PR 14495.