Make comment style consistent.
Send error message to STDERR.
Remove spurious comment.
Match the whole branch name.
Use `if` instead of `unless` for clarity.
Use IO.popen instead of backticks.