Fix pattern loading bug.