I have run into an issue in the past with the Graal serverside where "&=" is what was failing to register properly, but even then it wasn't giving me '2' as in your case it was just giving me nulls or something.
I fixed it with something like "a = @b & @(~c);"
Graal is down at the moment so I can't verify or look it up.