Replace some uses of var that were missed in the var->ref switch