Fixed empty queue code.