changing toByte to getBytes to fix json output

Fixes #197 - not sure if this ever worked before but this fixes it.
do we trust the default CharSet here, or should it be e.g. `.getBytes("UTF-8")`?