Fix bug in ShortenUrls

Previously the method would hang in the event of an error.
Merge branch 'master' into uncodin