Made serialize non-recursive.