Improve doc and tests