Bugfix in SerializeToStream + Unit tests
Merge pull request #404 from starteleport/master

Fix & Unit tests