ATS: Fix VS warning and errors