Escape the CID when searching as well

Also, add a debug statement, since no match results in an null element,
not an error.