PR #149: Resolve Potential PanicsFix 8 potential panic points in Rust unsafe code and improve overall code safety