Minor speed improvement for variable searching