Fixed wildcards matches to be anchored. Also added tests.