Fixed an issue with JSON encoding non-ascii bytes.