Check exit value properly.