Fix and add documentation.