Fixed compilation and ARC issues when compiling with XCode5.
Merge remote-tracking branch 'origin/master' into release-2.1