 +		kdbGetChildKeys(handle, buffer,settings,
 +			KDB_O_DIR | KDB_O_NOVALUE | KDB_O_SORT);
 +		if (ksGetSize(settings))
-+			monitor->mon_modeline_lst=ksToModes(settings);
++			monitor->mon_modeline_lst=ksToModes(handle, settings);
 +		ksClose(settings);
 +
 +		/* Now get this monitor's options */

+		optionKeys = ksNew();
+		kdbGetChildKeys(handle, options,optionKeys,KDB_O_SORT | KDB_O_DIR);
+		if (ksGetSize(optionKeys))
+			screen->scrn_display_lst=ksToDisplays(optionKeys);
+		xf86conffree (options);
+		ksClose(optionKeys);
+		

+		if (ksGetSize(realModes)) {
+			ptr->mon_modeline_lst=(XF86ConfModeLinePtr)
+				xf86addListItem ((glp) ptr->mon_modeline_lst,
+					(glp) ksToModes(handle, realModes));
+		}
+
+		ksDel(realModes);
