masks: hopefully better fix for regression when removing shapes