Bug fixed where user defined patterns were unavailable

The `patterns` variable got overwritten by a local variable in the config function, which made the user defined patterns unavailable in `tools.patterns` check function.