fix compile errors on XCode