brush masks: minor fix and code cleanup