Add checks for bad wildcarded flows.

This commit add functions to check if a masked field is valid.