Fix #13741. Make wrap/unwrap methods optional. Close gh-1222.