Change not to use unsafe code.