Bug fixes and workarounds

Bug fixes and workarounds, most notably a workaround for #107
Merge pull request #108 from charsleysa/metadata

Bug fixes and workarounds