Shell change and more error catching