Some documentation fixes

Tried to beautify the inline documentation and fix some errors. No functional changes
Also, looks like the docs were missing `}` and some `;`-s as well - could you add them too?