Handle end-of-queue properly, no crash\!
Merge from master