Fix fromJavaString with substrings that have count and/or offset == 0