Made bad name cleanup appropriate for bg use