Small fix to JSON encoding: