Fixed a couple of bugs when adjustvars was a vector