For some strange reason, in #Scripting on DALnet, today we got around 3 queries regarding why $address doesn't work sometimes.
One of our operators said to use $mask with $fulladdress, eg: $mask($fulladdress,3), not sure why, but it seems to fix the issue.