ANSI C support fixes

Small fortran fix in example
After running gfortran to check for f2003 compliance it turns out that
CALL EXIT is problematic (GNU extension). Will leave it in for now since
most compilers probably support it anyway.
ERROR STOP from F2008 could be a solution for this...