fixed aliasing bug in NewVar()