Added some useful string utilities. And fixed bugs.