Improved tests of marshaling.

Now most of tests works for both directions.