Fix searching for strings with whitespace
Fix an occasional deadlock when invoking extensions