Remove some pattern matches and add some debug