Some tweaks to work with xcodebuild, some workaraounds for ocling bugs