Fix API documentation. Fixes #306.