sdk: Fixed many warnings and related problems