Queue handling fixes