Modified function names, fixed compile errors