Fixed variable name. Display search query in the error message when type inspection fails.