Fix the last code-style errors and add some documentation