Changing to to_jstring()

We seems to have a few string conversion problems - see also #529.

@bmunkholm @kspangsege 
shouldn't this be file_name? (not _tmp)