Pattern correction