Updated the MetaDataWriter.java file.

Due to errors found during tests , it was necessary to change this file.