Fixed segfaults caused by errors in Fortran wrapper generation