improved doc, fixed tests