Changed the doc comment style. Added some Doxygen doc comments. Removed calls to exit for proper error reporting.