fixes to the mersenne twister