Bug fixes to Fortran wrappers