fixed some compilations warnings and  errors on 10.8 and 10.9