Updated core JSON code to handle complex types.