Fixed tests and added docs.