Fix function definitions