Tweaks to p matching in flow mode