Fix tests

There actually wasn't as much unsafe code as I thought there would be.