Fix 'undefined method' error encountered with layer masks