TRACE -> DEBUG
more improvements to variable matching