xmile: correctly collect the referenced variables