Update getLongTitle to fall back to basename

Update getLongTitle to fall back to basename when the relative path
resolves to a blank string.