The simplest fix would be to use $mkfn($lower($left($nick,1))) - that way if the character is invalid in a filename it will be converted to an underscore. You'd have all chars like _|/\: in the same file, but those characters are relatively rare at the start of a nickname so it shouldn't make that file any larger than the others.