Fixed C function