Added some documentation and fixed memory leak in GetBoxText()