Improve tests and doc.