Fix a bunch of bugs, most notably case insensitive matching.
Fix some regex edge case issues
remove some logging