fixed some fortran and C problems