thats becasue
find_replace_templatesets("stats", '\#$footer', "\$server_stats\n\$footer");
should be
find_replace_templatesets("stats", '#\$footer', "\$server_stats\n\$footer");
I'm using this now (Because off another warning)
find_replace_templatesets("stats", '#\$footer#', "\$server_stats\n\$footer");
Thanks

You're good
