Updated the project to a more modern SDK.
Fixed some warnings pointed out by the clang analyzer and AppCode.