Pipe error into tmpError when serializing child objects.
Add test for #165
Made fixes requested by @robb
Merge pull request #166 from maxgoedjen/master

Pipe error into tmpError when serializing child objects.