Prepared doxygen documentation and fixed some issues