Check exit code