I have seen something like this before, very hard to find. I think what helped was using .value(var) instead of .at(var), it's null pointer safe.