Xcode 4.6 compatibility and some ARC/LLVM warnings fixed.