Fixed some errors, queue shouldn't be removed when removing iterator