Fixing more queue-based bugs