Added -W flag to regular build and fixed related warnings