Added tests for serialization