Add unit test for C01B sampling, and bug fix in sampling

This fixes #299
A bug was discovered after adding the unit test and fixed. The bug fix is based on the assumption that b01c, and its test are correct.