bug fix in testing match gate; makes gate independent of flow speed