The mas/maf definition is correct syntax-wise, it just makes no sense logic-wise, as the series contain nothing.

I have explained the missing pointer error already above. Your function expects a series for the second parameters, not a var.