Fix #4: make the test that uses random seed more robust