Check exit status