Fixed crash while updating statistics