diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp
index 0bb097f..86adc28 100644
--- a/pykd/dbgext.cpp
+++ b/pykd/dbgext.cpp
@@ -566,22 +566,14 @@ py( PDEBUG_CLIENT4 client, PCSTR args)
         std::string     filePath;
         DbgPythonPath   dbgPythonPath;
         
+        
         if ( dbgPythonPath.findPath( argsList[0], fullFileName, filePath ) )
         {
-            DWORD       oldCurDirLen = GetCurrentDirectoryA( 0, NULL );
-
-	        std::vector<char> oldCurDirCstr(oldCurDirLen);
-            
-            GetCurrentDirectoryA( oldCurDirLen, &oldCurDirCstr[0] );
-            
-           // SetCurrentDirectoryA( filePath.c_str() );
-            
-            try {                  
-            
+            try {             
+          
                 boost::python::object       result;
         
                 result =  boost::python::exec_file( fullFileName.c_str(), global, global );
-                
             }                
             catch( boost::python::error_already_set const & )
             {
@@ -603,13 +595,11 @@ py( PDEBUG_CLIENT4 client, PCSTR args)
                 Py_XDECREF(errtype);
                 Py_XDECREF(traceback);        
             }  
-            
-            SetCurrentDirectoryA( &oldCurDirCstr[0] );
         }
         else
         {
       		dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "script file not found\n" );
-        }           
+        }  
     }
    
     catch(...)
diff --git a/pykd/dbgpath.cpp b/pykd/dbgpath.cpp
index e2ea4d2..51b6379 100644
--- a/pykd/dbgpath.cpp
+++ b/pykd/dbgpath.cpp
@@ -86,6 +86,7 @@ DbgPythonPath::findPath(
             
     if ( bufSize > 0 )    
     {
+        bufSize += 1;
 		std::vector<char> fullFileNameCStr(bufSize);
         char    *partFileNameCStr = NULL;
 
@@ -95,12 +96,14 @@ DbgPythonPath::findPath(
             pyExt ? NULL : ".py",
             bufSize,
             &fullFileNameCStr[0],
-            &partFileNameCStr );              
+           &partFileNameCStr );          
 
         fullFileName = std::string( &fullFileNameCStr[0] );
-        filePath = std::string( &fullFileNameCStr[0], partFileNameCStr );
-
-        return true;        
+        if ( !fullFileName.empty() )
+        {
+            filePath = std::string( &fullFileNameCStr[0], partFileNameCStr );
+            return true;        
+        }            
     }                
             
     // 2. ���� �� ���� �����������, ��������� � m_pathList
@@ -120,21 +123,24 @@ DbgPythonPath::findPath(
                 
         if ( bufSize > 0 )
         {
+            bufSize += 1;
 			std::vector<char> fullFileNameCStr(bufSize);
             char    *partFileNameCStr = NULL;
             
-            SearchPathA(
+            bufSize = SearchPathA(
                 (*it).c_str(),
                 fileName.c_str(),
                 pyExt ? NULL : ".py",
                 bufSize,
                 &fullFileNameCStr[0],
-                &partFileNameCStr );              
-            
-            fullFileName = std::string( &fullFileNameCStr[0] );
-            filePath = std::string( &fullFileNameCStr[0], partFileNameCStr );
-            
-            return true;
+                &partFileNameCStr );          
+                
+            fullFileName = std::string( &fullFileNameCStr[0] );                
+            if ( !fullFileName.empty() )
+            {                    
+                filePath = std::string( &fullFileNameCStr[0], partFileNameCStr );
+                return true;
+            }                
         }                  
     }