Added shutdown error handling (not really)