Added sorting. discovered too-many-wildcard bug.