Bugfix binary encoded json

I believe this fixes #222, cc @jorin-vogel, @jancborchardt