unit tests and fixes for deterministic parts of the sampler; integration test still failing