Lots of tidying up. UDP still busted.