Finally fixed all the MSVS compiler warnings