Add list of tags for current commit to error output. Minor refactoring along the way.