Fix Fortran functions