Throw error before attempting to read non-tree object.
Merge pull request #134 from rjackson/error-on-invalid-tree

Throw error before attempting to read non-tree object.