Fixed writing to files
Fixed merge
Fixed writing to files