Fix warning Fix xcode Use math min, use correct caseing for non windows Fix more warnings Fix warning