Fixed bugs on Some platforms