Fixed invalid state update (fail/remove)
Added dequeue tests