adding serialization to unit tests and fixing descriptor checks. Fixes #4