First attempt at fixing compiler error and warning on XCode 4.5