Fixed indenting and doxygen comments.
Fixed a few warnings/bugs.