diff --git a/libdjvu/ByteStream.cpp b/libdjvu/ByteStream.cpp
index 840885d..4361312 100644
--- a/libdjvu/ByteStream.cpp
+++ b/libdjvu/ByteStream.cpp
@@ -674,7 +674,12 @@ urlfopen(const GURL &url,const char mode[])
 #elif defined(__APPLE__)
   return fopen((const char *)url.UTF8Filename(),mode);
 #else
-  return fopen((const char *)url.NativeFilename(),mode);
+   // looks like GUTF8String destructor called just after cast
+   GUTF8String fileNameString = url.UTF8Filename();
+   const char *nativeFilename = (const char *)fileNameString;
+   return fopen(nativeFilename,mode);
+
+//  return fopen((const char *)url.NativeFilename(),mode);
 #endif
 }
 
diff --git a/libdjvu/GException.cpp b/libdjvu/GException.cpp
index 4585ebe..41ba1e5 100644
--- a/libdjvu/GException.cpp
+++ b/libdjvu/GException.cpp
@@ -215,7 +215,7 @@ static void throw_memory_error() { G_THROW(GException::outofmemory); }
 static void (*old_handler)() = std::set_new_handler(throw_memory_error);
 # else 
 #   ifdef HAVE_STDINCLUDES
-static void (*old_handler)() = std::set_new_handler(throw_memory_error);
+//static void (*old_handler)() = std::set_new_handler(throw_memory_error);
 #   else
 static void (*old_handler)() = set_new_handler(throw_memory_error);
 #  endif // HAVE_STDINCLUDES
diff --git a/libdjvu/GThreads.cpp b/libdjvu/GThreads.cpp
index 0b0fe0a..7815103 100644
--- a/libdjvu/GThreads.cpp
+++ b/libdjvu/GThreads.cpp
@@ -446,8 +446,10 @@ GThread::create(void (*entry)(void*), void *arg)
 void 
 GThread::terminate()
 {
+#ifndef __ANDROID__
   if (xentry || xarg)
     pthread_cancel(hthr);
+#endif
 }
 
 int
diff --git a/libdjvu/miniexp.cpp b/libdjvu/miniexp.cpp
index 48ec739..1503bcb 100644
--- a/libdjvu/miniexp.cpp
+++ b/libdjvu/miniexp.cpp
@@ -1241,7 +1241,8 @@ static int stdio_fputs(miniexp_io_t *io, const char *s) {
 
 static int true_stdio_fgetc(miniexp_io_t *io) {
   FILE *f = (io->data[0]) ? (FILE*)(io->data[0]) : stdin;
-  return ::getc(f);
+//  return ::getc(f);
+  return getc(f);
 }
 static int compat_getc() { 
   return true_stdio_fgetc(&miniexp_io); 
