Fixed bug with non-ascii strings. Fixes #187