Fixed bug with inconsistent serialization/deserialization in matching