Fixed several bugs. Simple send-receive test works and terminates now. UDT thread are not cleaned up yet