Fix gi function.