Fix a bug in dmg formats, and add debug output.