Some more json_encode fixed for PHP < 5.2

From http://www.stetsenko.net/2009/09/php-json_encode-before-5-2-0/