Test for heuristic mrandom
Fix for the heuristic mrandom bug found by the test...
cleanup