diff -U 10 -r -N old/AppletHandlerFactory.java new/AppletHandlerFactory.java
--- old/AppletHandlerFactory.java	2007-04-01 14:07:31.000000000 -0500
+++ new/AppletHandlerFactory.java	2007-10-07 14:55:54.000000000 -0500
@@ -395,33 +395,20 @@
 				Class.forName("sun.plugin.AppletViewer").
 					getMethod("setupVersionProperties", (Class[]) null).
 					invoke(null, (Object[]) null);
 			} catch (Throwable e) {
 				System.err.println("AppletHandlerFactory: initProperties(): exception: " +
 					e.getMessage());
 				e.printStackTrace();
 			}
 		}
 		MyJavaRunTime.initJavaRunTime();
-		// As of "Java for Mac OS X 10.4 Release 5", Apple now sets the
-		// maximum heap size to 96 MB.  But it doesn't do this in a way that's
-		// accessible to the JEP, so we need to do it ourselves.  I've chosen
-		// to simply set the maximum heap size to 96 MB whenever we run on
-		// OS X 10.4 or higher (if it hasn't already been set by the user in
-		// the Java Control Panel).  This resolves
-		// http://sourceforge.net/forum/forum.php?thread_id=1696451&forum_id=371125.
-		// See http://developer.apple.com/releasenotes/Java/Java104R5RN/index.html.
-		if ((getOSXVersion() >= 0x1040) &&
-			(System.getProperty("javaplugin.maxHeapSize") == null))
-		{
-			System.setProperty("javaplugin.maxHeapSize", "96m");
-		}
 	}
 
 	// This needs to be called either on the main thread or before a
 	// SecurityManager is created (in AppletViewer.initProperties(), called
 	// from MyJavaRunTime.initJavaRunTime()).  The contents of our policy file
 	// gets added to other, existing policy files -- usually the system policy
 	// file and (if one exists) the user's policy file.  Since our policy file
 	// is added last, it doesn't override anything in the other policy files.
 	protected static void giveOurselvesAllPermissions() {
 		int n = 1;
diff -U 10 -r -N old/AppletView.m new/AppletView.m
--- old/AppletView.m	2007-04-18 17:15:27.000000000 -0500
+++ new/AppletView.m	2007-10-07 14:55:33.000000000 -0500
@@ -2570,39 +2570,57 @@
 		installedPathUTF8);
 
 	len = strlen("-Djep.pluginhome=") + installedPathLen + 1;
 	if ((ourPluginHome = (char *) malloc(len*sizeof(char))) == nil) {
 		free(classpathOpt);
 		free(ourJarOpt);
 		return ENOMEM;
 	}
 	sprintf(ourPluginHome, "-Djep.pluginhome=%s", installedPathUTF8);
 
-	numOpts = 14;
+	numOpts = 16;
 	if (jvmExtraOpts)
 		numOpts += jvmExtraOptsNum;
 	if ((runtimeParams = [AppletView getRuntimeParams]) != nil)
 		numOpts += [runtimeParams count];
 	if ((opts = (JavaVMOption *) malloc(numOpts*sizeof(JavaVMOption))) == nil) {
 		free(classpathOpt);
 		free(ourJarOpt);
 		free(ourPluginHome);
 		return ENOMEM;
 	}
 	memset(opts, 0, numOpts*sizeof(JavaVMOption));
 	i = 1;
 	if (jvmExtraOpts) {
 		for (; i <= jvmExtraOptsNum; ++i) {
 			opts[i-1].optionString = jvmExtraOpts[i-1].optionString;
 			opts[i-1].extraInfo = jvmExtraOpts[i-1].extraInfo;
 		}
 	}
+	/* As of "Java for Mac OS X 10.4 Release 5", Apple now sets the maximum
+	 * heap size to 96 MB.  But it doesn't do this in a way that's accessible
+	 * to the JEP, so we need to do it ourselves.  I've chosen to simply set
+	 * the maximum heap size to 96 MB whenever we run on OS X 10.4 or higher.
+	 * Since Java Control Panel settings are processed later, they can
+	 * override this setting.
+	 * In JEP 0.9.6.1 I tried to accomplish this by setting the javaplugin.
+	 * maxHeapSize property in AppletHandlerFactory.initProperties().  But
+	 * that didn't work, so now (as of JEP 0.9.6.4) I do it as follows.
+	 * This resolves
+	 * http://sourceforge.net/forum/forum.php?thread_id=1696451&forum_id=371125 and
+	 * http://sourceforge.net/tracker/index.php?func=detail&aid=1796738&group_id=107955&atid=649116.
+	 * See http://developer.apple.com/releasenotes/Java/Java104R5RN/index.html.
+	 */
+	if (osxVersion >= 0x1040) {
+		opts[i++-1].optionString = "-Xmx96m";
+		opts[i++-1].optionString = "-Djavaplugin.maxHeapSize=96m";
+    }
 	if (runtimeParams) {
 		count = [runtimeParams count];
 		for (j = 1; j <= count; ++j) {
 			parm = [runtimeParams objectAtIndex:j-1];
 			opts[i++-1].optionString = (char *) [parm UTF8String];
 		}
 	}
 	opts[i++-1].optionString = classpathOpt;
 	opts[i++-1].optionString = ourJarOpt;
 	opts[i++-1].optionString = ourPluginHome;
diff -U 10 -r -N old/JavaEmbeddingPlugin.h new/JavaEmbeddingPlugin.h
--- old/JavaEmbeddingPlugin.h	2007-04-18 10:28:10.000000000 -0500
+++ new/JavaEmbeddingPlugin.h	2007-10-06 20:46:43.000000000 -0500
@@ -37,21 +37,21 @@
  * handler in a browser that (like all of the Mozilla family) assumes applet
  * creation and initialization will be synchronous.  To go back to the
  * original, fully asynchronous behavior, add "-Djep.asyncinit=true" to the
  * Java Control Panel's "runtime parameters".)
  */
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define JEP_VERSION "0.9.6.3"
+#define JEP_VERSION "0.9.6.4"
 #define JEP_VERSION_OPTION "jep.version"
 
 /* As described above */
 #define JEP_ASYNCINIT_OPTION "jep.asyncinit"
 /* As of JEP 0.8.7, JSObject's methods (the Java-to-JavaScript LiveConnect
  * calls) time out after a fairly long interval (currently 2000 milliseconds).
  * This was how versions 0.8.3 through 0.8.5 behaved.  Version 0.8.6 waited
  * indefinitely for these calls to return.  This sometimes allows poorly
  * written applets to hang the browser, but timing out the calls can also
  * cause trouble.  Adding "-Djep.jsobjectnotimeout=true" to the Java Control
