Some documentation fixes

Tried to beautify the inline documentation and fix some errors. No functional changes