Fixing XCode5 errors and warnings