Prefix mode detection first check exact match first.