Make sure nextQueue isn't empty before popping
Simplify queue popping