Fixed pattern search.

Change-Id: I8c06cf25b7ee3a6118d8648ff17d72e05abdbb77