More metadata gathering and exception handling.
Merge pull request #10 from jk0/master

More metadata gathering and exception handling.