Fixed warnings that caused runtime errors in Xcode 4.2