Minor fixes to sample method, costs, and samples tests