Merge Gary's king safety tweak