diff --git a/apps/app_queue.c b/apps/app_queue.c
index 174bd0a99a02eef9b857e12cd259bbe7a471db8e..265c82dcd49e9992d81f47f037bf4201f9266cc6 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -817,7 +817,6 @@ static int try_calling(struct queue_ent *qe, char *options, char *announceoverri
 			res2 = ast_autoservice_start(qe->chan);
 			if (!res2)
 				res2 = ast_streamfile(peer, announce, peer->language);
-			/* XXX Need a function to wait on *both* streams XXX */
 			if (!res2)
 				res2 = ast_waitstream(peer, "");
 			res2 |= ast_autoservice_stop(qe->chan);
diff --git a/channel.c b/channel.c
index 85215f703afd3cf1ef76b06a6f714351ba91c8a0..3ec67e2bf4a9a8818338d23a59b9618065bf5bc1 100755
--- a/channel.c
+++ b/channel.c
@@ -1542,7 +1542,6 @@ struct ast_channel *ast_request(char *type, int format, void *data)
 			if (chan->requester)
 				c = chan->requester(type, capabilities, data);
 			if (c) {
-//				ast_device_state_changed(c->name);
 				if (c->_state == AST_STATE_DOWN) {
 					manager_event(EVENT_FLAG_CALL, "Newchannel",
 					"Channel: %s\r\n"
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 404862ee2f4fc0b392d9fe8e086a8785c58e05c7..2893046c8b895c94337e883f49fe4a62fafbe3be 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -128,11 +128,18 @@ static struct agent_pvt {
 	} \
 } while(0)
 
+/* Cleanup moves all the relevant FD's from the 2nd to the first, but retains things
+   properly for a timingfd XXX This might need more work if agents were logged in as agents or other
+   totally impractical combinations XXX */
+
 #define CLEANUP(ast, p) do { \
 	int x; \
 	if (p->chan) { \
-		for (x=0;x<AST_MAX_FDS;x++) \
-			ast->fds[x] = p->chan->fds[x]; \
+		for (x=0;x<AST_MAX_FDS;x++) {\
+			if (x != AST_MAX_FDS - 2) \
+				ast->fds[x] = p->chan->fds[x]; \
+		} \
+		ast->fds[AST_MAX_FDS - 3] = p->chan->fds[AST_MAX_FDS - 2]; \
 	} \
 } while(0)
 
@@ -247,7 +254,10 @@ static struct ast_frame  *agent_read(struct ast_channel *ast)
 	CHECK_FORMATS(ast, p);
 	if (p->chan) {
 		p->chan->exception = ast->exception;
-		p->chan->fdno = ast->fdno;
+		if (ast->fdno == AST_MAX_FDS - 3)
+			p->chan->fdno = AST_MAX_FDS - 2;
+		else
+			p->chan->fdno = ast->fdno;
 		f = ast_read(p->chan);
 	} else
 		f = &null_frame;