Updated pointer handling to comply with latest Rust