A modified version of Vidar Madsen's --compare-dest patch.