Fixes #4972: More robust friendly titles implementation