Fixed serialize method for stacks added vector specialization

of serialize.