fixing various xcode 5.1 warnings

This commit adds warning flags and fix all resulting warnings from an Xcode 5.1 Analyze.