Some fixes to the function file

Some fixes to the function file