Fix typos in some comments.
Consistently update the queue after file add or remove operations. Address #1011.