Write Metadata and other improvements....