Made the queue removal system more error proof.
Fixed merge conflicts