bugfixes for extractAndMatch