[CS TH] Tests (and a bug-fix!)