Fix undefined index error.