Fixes to serializer.  Refactor of error handling.