Two minor JNI fixes.

(1) In the CheckJNI return type scanner, don't assume that the caller's
class loader is already listed as an initiating loader for the type
being returned.

(2) Make sure the PlatformAddress class is initialized before calling
one of its static methods from NewDirectByteBuffer.
diff --git a/vm/CheckJni.c b/vm/CheckJni.c
index ff75770..ff0efd3 100644
--- a/vm/CheckJni.c
+++ b/vm/CheckJni.c
@@ -85,12 +85,13 @@
          *
          * Since we're returning an instance of declType, it's safe to
          * assume that it has been loaded and initialized (or, for the case
-         * of an array, generated), so we can just look for it in the
-         * loaded-classes list.
+         * of an array, generated).  However, the current class loader may
+         * not be listed as an initiating loader, so we can't just look for
+         * it in the loaded-classes list.
          */
         ClassObject* declClazz;
 
-        declClazz = dvmLookupClass(declType, method->clazz->classLoader, false);
+        declClazz = dvmFindClassNoInit(declType, method->clazz->classLoader);
         if (declClazz == NULL) {
             LOGW("JNI WARNING: method declared to return '%s' returned '%s'\n",
                 declType, objType);
diff --git a/vm/Jni.c b/vm/Jni.c
index 1029cdd..7b68195 100644
--- a/vm/Jni.c
+++ b/vm/Jni.c
@@ -3545,6 +3545,11 @@
     Object* platformAddress = NULL;
     JValue callResult;
     jobject result = NULL;
+    ClassObject* tmpClazz;
+
+    tmpClazz = gDvm.methOrgApacheHarmonyLuniPlatformPlatformAddress_on->clazz;
+    if (!dvmIsClassInitialized(tmpClazz) && !dvmInitClass(tmpClazz))
+        goto bail;
 
     /* get an instance of PlatformAddress that wraps the provided address */
     dvmCallMethod(self,
@@ -3559,10 +3564,10 @@
     LOGV("tracking %p for address=%p\n", platformAddress, address);
 
     /* create an instance of java.nio.ReadWriteDirectByteBuffer */
-    ClassObject* clazz = gDvm.classJavaNioReadWriteDirectByteBuffer;
-    if (!dvmIsClassInitialized(clazz) && !dvmInitClass(clazz))
+    tmpClazz = gDvm.classJavaNioReadWriteDirectByteBuffer;
+    if (!dvmIsClassInitialized(tmpClazz) && !dvmInitClass(tmpClazz))
         goto bail;
-    Object* newObj = dvmAllocObject(clazz, ALLOC_DONT_TRACK);
+    Object* newObj = dvmAllocObject(tmpClazz, ALLOC_DONT_TRACK);
     if (newObj != NULL) {
         /* call the (PlatformAddress, int, int) constructor */
         result = addLocalReference(env, newObj);