Fix issue when using nonull and pattern contains {}.