Minor fix for nil issue in new code