Fix missing include and serialization of shared_ptr