diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c
index 85864b05c5615ddf928ddbc3bc872835a8b1df6e..227ab94f8483fe2d2e243c9a3a06bc4ba248f4b4 100644
--- a/LUFA/Drivers/USB/Class/Host/CDC.c
+++ b/LUFA/Drivers/USB/Class/Host/CDC.c
@@ -182,7 +182,8 @@ static uint8_t DComp_CDC_Host_NextCDCInterfaceEndpoint(void* const CurrentDescri
 	
 		uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
 	
-		if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))
+		if (((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) &&
+		    !(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress)))
 		{
 			return DESCRIPTOR_SEARCH_Found;
 		}
diff --git a/LUFA/Drivers/USB/Class/Host/RNDIS.c b/LUFA/Drivers/USB/Class/Host/RNDIS.c
index 5966ed8516fe9655de87ff68b4bc43b41419152e..b06b890244b4d3ab54e9231356e73c7aa1709483 100644
--- a/LUFA/Drivers/USB/Class/Host/RNDIS.c
+++ b/LUFA/Drivers/USB/Class/Host/RNDIS.c
@@ -179,7 +179,8 @@ static uint8_t DComp_RNDIS_Host_NextRNDISInterfaceEndpoint(void* const CurrentDe
 	
 		uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
 	
-		if ((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT))
+		if (((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) &&
+		    !(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress)))
 		{
 			return DESCRIPTOR_SEARCH_Found;
 		}
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h
index ff0b640a44519ffba48ba17d82400e84cac18261..b0934f5868bc20b68b1485b58dafd3d88db6b21f 100644
--- a/LUFA/Drivers/USB/LowLevel/Endpoint.h
+++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h
@@ -126,6 +126,11 @@
 			 */
 			#define ENDPOINT_EPNUM_MASK                   0x07
 
+			/** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's
+			 *  direction for comparing with the ENDPOINT_DESCRIPTOR_DIR_* masks.
+			 */
+			#define ENDPOINT_EPDIR_MASK                   0x80
+
 			/** Endpoint bank size mask, for masking against endpoint addresses to retrieve the endpoint's
 			 *  bank size in the device.
 			 */
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c
index e88aa63fcd0530e7e1c4a5bd11392a46ed17b110..2b956a8da0360c4b8bab41d07b5ce33d58f4fa76 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -78,8 +78,15 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
 	{
 		Pipe_SelectPipe(PNum);
 		
-		if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))
-		  return true;
+		uint8_t PipeToken = Pipe_GetPipeToken();
+
+		if (PipeToken != PIPE_TOKEN_SETUP)
+		  PipeToken = (PipeToken == ((EndpointAddress & PIPE_EPDIR_MASK) ? PIPE_TOKEN_IN : PIPE_TOKEN_OUT));
+		
+		if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)) && PipeToken)
+		{		
+			return true;
+		}
 	}
 	
 	Pipe_SelectPipe(PrevPipeNumber);
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h
index afae6bcfbd31bf133a536d9a9f6b9f6fd6ae9edb..16b5ea670caa5d2f8dbcd4f1baff50e499e38236 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.h
@@ -175,6 +175,11 @@
 			 */
 			#define PIPE_EPNUM_MASK                 0x0F
 
+			/** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's
+			 *  direction for comparing with the ENDPOINT_DESCRIPTOR_DIR_* masks.
+			 */
+			#define PIPE_EPDIR_MASK                 0x80
+
 		/* Pseudo-Function Macros: */
 			#if defined(__DOXYGEN__)
 				/** Indicates the number of bytes currently stored in the current pipes's selected bank.
@@ -805,9 +810,10 @@
 			/** Determines if a pipe has been bound to the given device endpoint address. If a pipe which is bound to the given
 			 *  endpoint is found, it is automatically selected.
 			 *
-			 *  \param[in] EndpointAddress Address of the endpoint within the attached device to check
+			 *  \param[in] EndpointAddress Address and direction mask of the endpoint within the attached device to check
 			 *
-			 *  \return Boolean true if a pipe bound to the given endpoint address is found, false otherwise
+			 *  \return Boolean true if a pipe bound to the given endpoint address of the specified direction is found, false
+			 *          otherwise
 			 */
 			bool Pipe_IsEndpointBound(const uint8_t EndpointAddress);
 		
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index 9c4e5dcc3c5de3fd7885d4f0aa74b313b7b40849..b9436d6feb5cf5e5a777e290e60df5a9655cc654 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -48,6 +48,7 @@
   *  - Fixed DFU bootloader programming not discarding the correct number of filler bytes from the host when non-aligned programming
   *    ranges are specified (thanks to Thomas Bleeker)
   *  - Fixed CDC and RNDIS host demos and class drivers - bidirectional endpoints should use two seperate pipes, not one half-duplex pipe
+  *  - Fixed Pipe_IsEndpointBound() not taking the endpoint's direction into account
   *
   *  \section Sec_ChangeLog091223 Version 091223
   *
diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt
index f9864cb5cb498d5ae9826f4c48166a2464389d47..23fbc1ef40eed0423690c5c1f0d56668f43f6242 100644
--- a/LUFA/ManPages/MigrationInformation.txt
+++ b/LUFA/ManPages/MigrationInformation.txt
@@ -23,6 +23,9 @@
  *      packed into a single USB packet. This means that the sending of MIDI events will now be delayed until the MIDI send
  *      pipe bank is full. To override this new behaviour and revert to the previous behaviour, the user application may manually
  *      flush the queued event(s) to the device by calling \ref MIDI_Host_Flush().
+ *    - The Pipe_IsEndpointBound() function now takes the endpoint's direction into account, by checking if the MSB of the endpoint's address
+ *      is set to denote IN endpoints. If the previous functionality where the direction is to be discounted is required, mask the endpoint
+ *      address against the \ref PIPE_EPNUM_MASK token before calling Pipe_IsEndpointBound().
  *
  *  <b>Device Mode</b>
  *    - The MIDI Device Class driver send and receive routines now operate on packed events, where multiple MIDI events may be
diff --git a/Projects/Webserver/Lib/HTTPServerApp.c b/Projects/Webserver/Lib/HTTPServerApp.c
index 7d29272b88c7deb65b372177c8ac4d72af6d8e74..e31bdbb0b5a7942b1f0d9d341b8e636cf671e839 100644
--- a/Projects/Webserver/Lib/HTTPServerApp.c
+++ b/Projects/Webserver/Lib/HTTPServerApp.c
@@ -43,8 +43,8 @@
 char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"
                                "Server: LUFA RNDIS\r\n"
                                "Connection: close\r\n"
-							   "MIME-version: 1.0\r\n"
-							   "Content-Type: ";
+                               "MIME-version: 1.0\r\n"
+                               "Content-Type: ";
 
 /** HTTP server response header, for transmission before a resource not found error. This indicates to the host that the given
  *  given URL is invalid, and gives extra error information.
@@ -52,9 +52,9 @@ char PROGMEM HTTP200Header[] = "HTTP/1.1 200 OK\r\n"
 char PROGMEM HTTP404Header[] = "HTTP/1.1 404 Not Found\r\n"
                                "Server: LUFA RNDIS\r\n"
                                "Connection: close\r\n"
-							   "MIME-version: 1.0\r\n"
-							   "Content-Type: text/plain\r\n\r\n"
-							   "Error 404: File Not Found";
+                               "MIME-version: 1.0\r\n"
+                               "Content-Type: text/plain\r\n\r\n"
+                               "Error 404: File Not Found";
 
 /** Default MIME type sent if no other MIME type can be determined */
 char PROGMEM DefaultMIMEType[] = "text/plain";
@@ -97,12 +97,9 @@ void WebserverApp_Callback(void)
 
 	if (uip_aborted() || uip_timedout() || uip_closed())
 	{
-		/* Connection is being terminated for some reason - close file handle if open */
-		if (AppState->FileOpen)
-		{
-			f_close(&AppState->FileHandle);
-			AppState->FileOpen = false;
-		}
+		/* Connection is being terminated for some reason - close file handle */
+		f_close(&AppState->FileHandle);
+		AppState->FileOpen = false;
 		
 		/* Lock to the closed state so that no further processing will occur on the connection */
 		AppState->CurrentState  = WEBSERVER_STATE_Closed;
@@ -159,7 +156,7 @@ void WebserverApp_Callback(void)
 static void Webserver_OpenRequestedFile(void)
 {
 	uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;
-	char*                     AppData     = (char*)uip_appdata;
+	char*               const AppData     = (char*)uip_appdata;
 	
 	/* No HTTP header received from the client, abort processing */
 	if (!(uip_newdata()))
@@ -199,12 +196,12 @@ static void Webserver_OpenRequestedFile(void)
 static void Webserver_SendResponseHeader(void)
 {
 	uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;
-	char*                     AppData     = (char*)uip_appdata;
+	char*               const AppData     = (char*)uip_appdata;
 
 	char*    HeaderToSend;
 	uint16_t HeaderLength;
 
-	/* Determine what HTTP header should be sent to the client */
+	/* Determine which HTTP header should be sent to the client */
 	if (AppState->FileOpen)
 	{
 		HeaderToSend = HTTP200Header;
@@ -216,6 +213,7 @@ static void Webserver_SendResponseHeader(void)
 		AppState->NextState = WEBSERVER_STATE_Closing;
 	}
 
+	/* Copy over the HTTP response header and send it to the receiving client */
 	HeaderLength = strlen_P(HeaderToSend);
 	strncpy_P(AppData, HeaderToSend, HeaderLength);
 	uip_send(AppData, HeaderLength);
@@ -227,7 +225,7 @@ static void Webserver_SendResponseHeader(void)
 static void Webserver_SendMIMETypeHeader(void)
 {
 	uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;
-	char*                     AppData     = (char*)uip_appdata;
+	char*               const AppData     = (char*)uip_appdata;
 
 	char*    Extension        = strpbrk(AppState->FileName, ".");
 	uint16_t MIMEHeaderLength = 0;
@@ -272,7 +270,7 @@ static void Webserver_SendMIMETypeHeader(void)
 static void Webserver_SendData(void)
 {
 	uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;
-	char*                     AppData     = (char*)uip_appdata;
+	char*               const AppData     = (char*)uip_appdata;
 
 	/* Must determine the maximum segment size to determine maximum file chunk size */
 	uint16_t MaxSegmentSize = uip_mss();
diff --git a/Projects/Webserver/makefile b/Projects/Webserver/makefile
index f0c4ad1a5b1639708e513be219fd3caed2d4c8da..e12a44e4599c8640d64cf4b0b61d23cd171ea822 100644
--- a/Projects/Webserver/makefile
+++ b/Projects/Webserver/makefile
@@ -134,8 +134,6 @@ SRC = $(TARGET).c                                                 \
 	  Lib/DataflashManager.c                                      \
 	  Lib/uip/uip.c                                               \
 	  Lib/uip/uip_arp.c                                           \
-	  Lib/uip/uiplib.c                                            \
-	  Lib/uip/psock.c                                             \
 	  Lib/uip/timer.c                                             \
 	  Lib/uip/uip-neighbor.c                                      \
 	  Lib/uip/conf/clock-arch.c                                   \