fix some issues when compiled with xcode6-beta5