Find out-of-order patterns and correct them