Fix rand package. Add doc to math package.