Added some doxygen comments.  Fixed a memory leak.