Made dist task more robust.
Merge pull request #87 from joshuacc/improved-dist

More robust `dist` task