Improved tests and docs.