Fix comparison bug in apply_patches.sh