Fixed problems with several patterns.