tern: fix a few incorrectly caught exceptions
tern: add a --dry-run option