--- ipe/lua/main.lua.orig	2011-08-30 02:51:20.000000000 +0200
+++ ipe/lua/main.lua	2011-08-31 15:26:17.000000000 +0200
@@ -147,8 +147,8 @@
 -- This function is called to launch a file
 
 function file_open_event(fname)
-  if first_model and first_model.pristine then
-    first_model.loadDocument(fname)
+  if first_model and not first_model.file_name and not first_model:isModified() then
+    first_model:loadDocument(fname)
   else
     MODEL:new(fname)
   end
@@ -249,11 +249,11 @@
 end
 
 config.ipeletDirs = {}
-for w in string.gmatch(config.ipelets, "[^;]+") do
+for w in string.gmatch(config.ipelets, "[^;:]+") do
   config.ipeletDirs[#config.ipeletDirs + 1] = w
 end
 
-if config.platform == "unix" then
+if config.platform == "unix" or config.platform == "apple" then
   table.insert(config.ipeletDirs, 1, config.home .. "/.ipe/ipelets")
 end
 
