Fixed 2 bug for Xcode 4.5