Fixed bug in #791

You were encoding an already encoded json =)