Improved SerializeWhen comparisson.