Correcting security patterns