Match case sensitive first. Fixes #584