Improved FreeCharacters() function