Fix undefined index check.