Written string size used sometimes the wrong encoding. Fixes #31