Test for randomized queue and bugfix