Fixed 2 bugs for Xcode 4.5