Fix vars function to optionally allow only an array to be passed.