Improved doc title handling