Fix undefined index notices in merge