masks: some further improvements for brush node elimination