Fixed the writing of tags making the file size double