Fix "cache lookup failed for type 0" in queries with string parameters.
Per report from Adolfho Lopes.