Fix overflow in init_safety