More idiomatic use of Try

Also fixes comparison of TypeTags.