Various corrections to avoid warnings with gfortran