OPAL-2046 Set search limit to be max number of variables
OPAL-2036 Check for variable existence before adding it