Fixed #2 by handling null values in JSON structure