Added test code for I/O of user-defined types.