jsonify: fix arrays handling. Tests.