Fix notices and formatting for word replacement