Fixed crash in trying to serialize nil