exclude: fix a bug in prefix compare optimization