Added some string safety functions