Revise the getVars() function, patch bug