Fixed memory leaks.  Added a check of a word's first character to avoid a seg fault I was getting while debugging.