Finish contents-file writing in safmdgen.rb