Fixed some bugs associated with varLists and array