Fix function names and refs