Document repair