Handle invalid masked setups more gracefully.

If the mask widget was not set up correctly, throw an Error with a hint.