Fixed unsafe code