Fix compilation errors

shared_ptr is used