Fix compile errors.
Add missing documentation.