Added defensive measures for nullable fields (optional as json)