[No reviewer needed] Add UT case for binomial distribution

I also hit another issue in the registrar tests under valgrind, so have fixed that in this check-in as well.