diff --git a/Kernel/arch/x86/mm_phys.c b/Kernel/arch/x86/mm_phys.c
index cd4187e5707b6847c3927ef00054b9a12b39d024..07318362da46ea7493ab5440cb9910eaaf9f708a 100644
--- a/Kernel/arch/x86/mm_phys.c
+++ b/Kernel/arch/x86/mm_phys.c
@@ -420,10 +420,10 @@ void MM_RefPhys(tPAddr PAddr)
 		{
 			 int	i, base;
 			tVAddr	addr = ((tVAddr)&gaPageReferences[PAddr]) & ~0xFFF;
-			Log_Debug("PMem", "MM_RefPhys: Allocating info for %X", PAddr);
+//			Log_Debug("PMem", "MM_RefPhys: Allocating info for %X", PAddr);
 			Mutex_Release( &glPhysAlloc );
 			if( MM_Allocate( addr ) == 0 ) {
-				Log_KernelPanic("PMem", "MM_RefPhys: Out of physical memory");
+				Log_KernelPanic("PMem", "MM_RefPhys: Out of physical memory allocating info for %X", PAddr*PAGE_SIZE);
 			}
 			Mutex_Acquire( &glPhysAlloc );
 			
diff --git a/Kernel/binary.c b/Kernel/binary.c
index fdb4dbaefe18c383ac01e2cf7945dac2b7e3b4c5..8b7e7448325974ca267618cf0abbfb7a015203d9 100644
--- a/Kernel/binary.c
+++ b/Kernel/binary.c
@@ -414,7 +414,7 @@ tBinary *Binary_DoLoad(tMount MountID, tInode Inode, const char *Path)
 {
 	tBinary	*pBinary;
 	 int	fp;
-	Uint	ident;
+	Uint32	ident;
 	tBinaryType	*bt = gRegBinTypes;
 	
 	ENTER("iMountID XInode sPath", MountID, Inode, Path);
@@ -426,19 +426,26 @@ tBinary *Binary_DoLoad(tMount MountID, tInode Inode, const char *Path)
 		LEAVE('n');
 		return NULL;
 	}
+
+	LOG("fp = 0x%x", fp);
 	
 	// Read File Type
 	VFS_Read(fp, 4, &ident);
 	VFS_Seek(fp, 0, SEEK_SET);
 
+	LOG("ident = 0x%x", ident);
+
 	// Determine the type	
 	for(; bt; bt = bt->Next)
 	{
-		if( (ident & bt->Mask) != (Uint)bt->Ident )
+		if( (ident & bt->Mask) != (Uint32)bt->Ident )
 			continue;
+		LOG("bt = %p (%s)", bt, bt->Name);
 		pBinary = bt->Load(fp);
 		break;
 	}
+
+	LOG("pBinary = %p", pBinary);
 	
 	// Close File
 	VFS_Close(fp);
diff --git a/Kernel/debug.c b/Kernel/debug.c
index e0c7af87ec302167a8072529c2e832e69d65bcfe..1718d209bea026fbbe36634eaee2b0d804c4ec47 100644
--- a/Kernel/debug.c
+++ b/Kernel/debug.c
@@ -228,9 +228,9 @@ void Debug_SetKTerminal(const char *File)
 		VFS_Close(tmp);
 	}
 	tmp = VFS_Open(File, VFS_OPENFLAG_WRITE);
-	Log_Log("Debug", "Opened '%s' as 0x%x", File, tmp);
+//	Log_Log("Debug", "Opened '%s' as 0x%x", File, tmp);
 	giDebug_KTerm = tmp;
-	Log_Log("Debug", "Returning to %p", __builtin_return_address(0));
+//	Log_Log("Debug", "Returning to %p", __builtin_return_address(0));
 }
 
 void Debug_Enter(const char *FuncName, const char *ArgTypes, ...)
diff --git a/Kernel/drv/pci.c b/Kernel/drv/pci.c
index 2e107a794a24c8e024c253e0e9cb34d90ba00528..f75b5acb708698c6ded7129d061438165146d886 100644
--- a/Kernel/drv/pci.c
+++ b/Kernel/drv/pci.c
@@ -373,7 +373,8 @@ void PCI_ConfigWrite(tPCIDev ID, int Offset, int Size, Uint32 Value)
 	
 	dev = &gPCI_Devices[ID];
 
-	dword = PCI_CfgReadDWord(dev->bus, dev->slot, dev->fcn, Offset/4);
+	if(Size != 4)
+		dword = PCI_CfgReadDWord(dev->bus, dev->slot, dev->fcn, Offset/4);
 	switch(Size)
 	{
 	case 1:
@@ -418,91 +419,6 @@ Uint32 PCI_GetBAR(tPCIDev id, int BARNum)
 	return gPCI_Devices[id].ConfigCache[4+BARNum];
 }
 
-#if 0
-/**
- * \brief Assign a port to a BAR
- */
-Uint16 PCI_AssignPort(tPCIDev ID, int bar, int Count)
-{
-	#if 1
-	Uint16	rv;
-	tPCIDevice	*dev;
-	
-	if(id < 0 || id >= giPCI_DeviceCount)	return 0;
-	if(bar < 0 || bar >= 6)	return 0;
-	dev = &gPCI_Devices[id];
-	
-	rv = PCI_CfgReadDWord( dev->bus, dev->slot, dev->fcn, 0x10+bar*4 );
-	if(rv & 1)	return rv & ~1;
-	return 0;
-	#else
-	Uint16	portVals;
-	 int	gran=0;
-	 int	i, j;
-	tPCIDevice	*dev;
-	
-	//LogF("PCI_AssignPort: (id=%i,bar=%i,count=%i)\n", id, bar, count);
-	
-	if(id < 0 || id >= giPCI_DeviceCount)	return 0;
-	if(bar < 0 || bar > 5)	return 0;
-	
-	dev = &gPCI_Devices[id];
-	
-	PCI_CfgWriteDWord( dev->bus, dev->slot,	dev->fcn, 0x10+bar*4, -1 );
-	portVals = PCI_CfgReadDWord( dev->bus, dev->slot, dev->fcn, 0x10+bar*4 );
-	dev->ConfigCache[4+bar] = portVals;
-	//LogF(" PCI_AssignPort: portVals = 0x%x\n", portVals);
-	
-	// Check for IO port
-	if( !(portVals & 1) )	return 0;
-	
-	// Mask out final bit
-	portVals &= ~1;
-	
-	// Get Granuality
-	#if ARCHDIR_IS_x86 || ARCHDIR_IS_x86_64
-	__asm__ __volatile__ ("bsf %%eax, %%ecx" : "=c" (gran) : "a" (portVals) );
-	gran = 1 << gran;
-	#else
-	{
-		for(gran = 1; gran && !(portVals & gran); gran <<= 1);
-	}
-	#endif
-	//LogF(" PCI_AssignPort: gran = 0x%x\n", gran);
-	
-	// Find free space
-	portVals = 0;
-	for( i = 0; i < 1<<16; i += gran )
-	{
-		for( j = 0; j < count; j ++ )
-		{
-			if( gaPCI_PortBitmap[ (i+j)>>5 ] & 1 << ((i+j)&0x1F) )
-				break;
-		}
-		if(j == count) {
-			portVals = i;
-			break;
-		}
-	}
-	
-	if(portVals)
-	{
-		for( j = 0; j < count; j ++ )
-		{
-			if( gaPCI_PortBitmap[ (portVals+j)>>5 ] |= 1 << ((portVals+j)&0x1F) )
-				break;
-		}
-		PCI_CfgWriteDWord( dev->bus, dev->slot, dev->fcn, 0x10+bar*4, portVals|1 );
-		dev->ConfigCache[4+bar] = portVals|1;
-	}
-	
-	// Return
-	//LogF("PCI_AssignPort: RETURN 0x%x\n", portVals);
-	return portVals;
-	#endif
-}
-#endif
-
 /**
  * \brief Get device information for a slot/function
  */
diff --git a/Kernel/syscalls.c b/Kernel/syscalls.c
index 00f031feead95f828495f4098b05254e929662f3..e304b40e2a9c25a1b5fd0fddec6e820229b69b13 100644
--- a/Kernel/syscalls.c
+++ b/Kernel/syscalls.c
@@ -350,10 +350,10 @@ void SyscallHandler(tSyscallRegs *Regs)
 	if( callNum != SYS_READ && callNum != SYS_WRITE ) {
 	# endif
 	LOG("err = %i", err);
-	if(Regs->Num != SYS_EXECVE)
-		LEAVE('x', ret);
-	else
+	if( callNum == SYS_EXECVE )
 		LOG("Actual %i", ret);
+	else
+		LEAVE('x', ret);
 	# if DEBUG < 2
 	}
 	# endif
diff --git a/Kernel/system.c b/Kernel/system.c
index f346d69c3b070351fb7fe250e314829f850ac769..986734cd56b6cef686aceaa63f448fdfeb2faccc 100644
--- a/Kernel/system.c
+++ b/Kernel/system.c
@@ -164,7 +164,7 @@ void System_ExecuteCommandLine(void)
 	 int	i;
 	for( i = 0; i < argc; i++ )
 	{
-		Log("argv[%i] = '%s'", i, argv[i]);
+		LOG("argv[%i] = '%s'", i, argv[i]);
 		switch(argv[i][0])
 		{
 		// --- VFS ---
@@ -317,17 +317,20 @@ void System_ExecuteScript(void)
 	tConfigFile	*file;
 	tConfigLine	*line;
 	
+	ENTER("");
+
 	// Open Script
 	fp = VFS_Open(gsConfigScript, VFS_OPENFLAG_READ);
 	if(fp == -1) {
 		Log_Warning("Config", "Passed script '%s' does not exist", gsConfigScript);
+		LEAVE('-');
 		return;
 	}
 	
 	// Get length
 	VFS_Seek(fp, 0, SEEK_END);
 	fLen = VFS_Tell(fp);
-	Log_Debug("System", "VFS_Tell(%i) = %i", fp, fLen);
+	LOG("VFS_Tell(0x%x) = %i", fp, fLen);
 	VFS_Seek(fp, 0, SEEK_SET);
 	// Read into memory buffer
 	fData = malloc(fLen+1);
@@ -350,7 +353,7 @@ void System_ExecuteScript(void)
 		// Prescan and eliminate variables
 		for( j = 1; j < line->nParts; j++ )
 		{
-			Log_Debug("Config", "Arg #%i is '%s'", j, line->Parts[j]);
+			LOG("Arg #%i is '%s'", j, line->Parts[j]);
 			bReplaced[j] = 0;
 			if( line->Parts[j][0] != '$' )	continue;
 			if( line->Parts[j][1] == '?' ) {
@@ -361,7 +364,7 @@ void System_ExecuteScript(void)
 				if( val < 0 || val > N_VARIABLES )	continue;
 				val = variables[ val ];
 			}
-			Log_Debug("Config", "Replaced arg %i ('%s') with 0x%x", j, line->Parts[j], val);
+			LOG("Replaced arg %i ('%s') with 0x%x", j, line->Parts[j], val);
 			line->Parts[j] = malloc( BITS/8+2+1 );
 			sprintf(line->Parts[j], "0x%x", val);
 			bReplaced[j] = 1;
@@ -408,7 +411,7 @@ void System_ExecuteScript(void)
 				else {
 					args[k] = (char *)line->Parts[k+1];
 				}
-				Log_Debug("Config", "args[%i] = %p", k, args[k]);
+				LOG("args[%i] = %p", k, args[k]);
 			}
 			switch( (enum eConfigCommands) caConfigCommands[j].Index )
 			{
@@ -438,7 +441,7 @@ void System_ExecuteScript(void)
 				result = VFS_IOCtl( (Uint)args[0], (Uint)args[1], (void *)args[2] );
 				break;
 			}
-			Log_Debug("Config", "result = %i", result);
+			LOG("Config", "result = %i", result);
 			break;
 		}
 		if( j < NUM_CONFIG_COMMANDS )	continue;
@@ -541,6 +544,8 @@ void System_ExecuteScript(void)
 	// Free data
 	free( file );
 	free( fData );
+	
+	LEAVE('-');
 }
 
 /**
@@ -550,7 +555,7 @@ void System_ExecuteScript(void)
  * \return ::tConfigFile structure that represents the original contents
  *         of \a FileData
  */
-tConfigFile	*System_Int_ParseFile(char *FileData)
+tConfigFile *System_Int_ParseFile(char *FileData)
 {
 	char	*ptr;
 	char	*start;
@@ -688,7 +693,7 @@ tConfigFile	*System_Int_ParseFile(char *FileData)
 	if( i < ret->nLines ) {
 		ret->Lines[i].nParts = 0;
 		ret->Lines[i].Parts = NULL;
-		Log_Log("System", "Cleaning up final empty line");
+		LOG("Cleaning up final empty line");
 	}
 	
 	LEAVE('p', ret);