Added serialize example

Also, fixed minor type.