Add documentation and missing function parameters.