Fixed some bugs in the truncated normal

The truncated normal implementation I submitted yesterday had a few bugs in - those have now been fixed.

I also added some tests to check whether generated random variates are actually in the support as given - it might be worthwhile extending these to other distributions.