Fix Debug for Libchan

This includes some minor cleanup among other things needed to make debug work with libchan (correctly).

Signed-off-by: John Hopper john.hopper@jpserver.net