Added composite example generator
Fixed file writer not closing stream