Various tweaks to queue logic