Updates to csum; add tests