Better serializer errors for nested writes.

Closes #2202.