Minor code cleanup

I simplified a few if statements and ran `go fmt` on the files that I modified. 
I'm afraid you are ignoring another error case here: what if `discovery.NewAppFromString()` returned an err, but `globalFlags.Debug` is not set?