Some string functions and tests