Changing to to_jstring()

We seems to have a few string conversion problems - see also #529.

@bmunkholm @kspangsege