The attached example shows that when you create an UnalignedBlock object and try to generate a NEXUS file with it, the write method fails because it does not create a taxa block (while a taxa block is requiered by the NEXUS format for unaligned blocks).
However, if the UnalignedBlock is replaced by a CharactersBlock, the write method succeeds. A new taxa block is automatically generated and everything is fine.
So, to be able to output an unaligned block, one has to create a taxa block and add it manually to the NEXUS object before calling the write method. You can check that in the given example by uncommenting the line followin "# ***".
demostrate the bug