Minor fix to handling empty array