Fixed read/write

Program now correctly reads and writes metadata without changing file
contents