Properly track variable usage in record expressions