Made the demo more elegant, fixed a bug with pointer deserialization