small tweaks to make script run for older versions of xcode