test improvements, and serialization fix