Fixed issues with shell command failure handling