Fixed python compatability issue in jsonify code