Fixing UDT implementation for name serialisation. Adding tests.