Fixed factory creation to avoid unconventional characters crash