fixed collect-vars function to allow variables in sets in RHS