Include metadata in download (fixed)

A tidy version of PR #314