You're right. It does have to do with the mask. Masking occurs before effects so, you must precompose before you apply masks if you want them to properly effect a layer.
This page talks about precomposing.
- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')
No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.