Fixed bug with variable queue sizes