One more bugfix: size of queue calculated incorrectly.