Fix UDP-related bugs. Minor format fixes.