Fix compilation with Mac SDK below 10.9 and clear some warnings.