Fix doc, add tests and fix fail