Support @a for /velocity in command blocks.
It seems $player is overwritten for each player when in a queue.