Tar fixes from dm

These are the tar related changes in the dm branch. If we can merge these first it will make the diff smaller for the dm branch.