Fix a bug in conversion between flow/mask and flow key