Fix handling of returning Option<&Object> from Rust functions