Tests added. Doc updated.