Fix endless loop in JSON node parsing