replaced Fortran calls to stop with calls to rexit so that exit commands get sent to R