Error handling for embedded non-struct types

Fixes #17.
Merge pull request #26 from cespare/issue-17

Error handling for embedded non-struct types