Corrected title generation bug