Fix string instance tests.

In the same spirit of #1952, this patch fix all string instance tests where it makes sense.