Improved title extraction