fix for generate_url
fix for setCustomLocale #655