Added more tests, updated doc.