Make var and var-ref searches work. Ref bug 1082100.