rename nd->var, fix tests